package com.ssm.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.Enumeration;

@Controller
public class TestController {
    @ResponseBody
    @RequestMapping(value = "test",method = RequestMethod.GET)
    public String Test(HttpSession session){
        session.setAttribute("B","bob");
        session.setAttribute("C","joe");
        Enumeration ee= session.getAttributeNames();

            System.out.println(ee.nextElement());

        return ee.toString();
    }
}
